<template>
  <el-button v-if="visible"
    v-waves
    :loading="downloadLoading"
    class="filter-item"
    type="primary"
    icon="el-icon-download"
    @click="handleDownload"
  >{{ $t('table.export') }}</el-button>
</template>

<script>
import waves from '@/directive/waves' // waves directive
export default {
  name: "exportBtn",
  directives: { waves },
  props: ["auth"],
  data() {
    return {
      visible: false
    };
  },
  created() {
    const btns = this.$store.getters.btnPermission;
    btns.forEach(item => {
      if (item.perms === this.auth) {
        this.visible = true;
        return;
      }
    });
  },
  methods: {
    handleDownload() {
      this.$emit("handleDownload");
    }
  }
};
</script>